define([ ], function(util) {
	return {
		// 存储单个属性
		set : function(key, value) {
			window.localStorage[key] = value;
		},
		// 读取单个属性
		get : function(key, defaultValue) {
			return window.localStorage[key] || defaultValue;
		},
		// 存储对象，以JSON格式存储
		setObject : function(key, value) {
			window.localStorage[key] = escape(JSON.stringify(value));
		},
		// 读取对象
		getObject : function(key) {
			return JSON.parse(unescape(window.localStorage[key]  || '{}'));
		},
		// 存储对象，以JSON格式存储
		setMap : function(key, mapObject) {
			var obj = new Object();
			mapObject.forEach(function(key, value){
				obj[key] = value;
			});
			window.localStorage[key] = escape(JSON.stringify(obj));
		},
		// 读取对象
		getMap : function(key) {
			var objMap = new Map(),
				obj = JSON.parse(unescape(window.localStorage[key]) || '{}');
			
			for(key in obj){
	            objMap.set(obj[key], key)
	        }
			return objMap;
		}
	}
});